﻿/*
 * User: David
 * Date: 30/06/2013
 * Time: 11:09 PM
 * 
 */
using System;
using System.Drawing;
using System.Windows.Forms;

namespace HockeySimulator
{
	/// <summary>
	/// Description of DebugWindow.
	/// </summary>
	public partial class DebugWindow : Form
	{
		public DebugWindow()
		{
			//
			// The InitializeComponent() call is required for Windows Forms designer support.
			//
			InitializeComponent();
			
			//
			// TODO: Add constructor code after the InitializeComponent() call.
			//
		}
		
		void BtnHideDebugWindowClick(object sender, EventArgs e)
		{
			this.Hide();
		}
		
		void DebugWindowFormClosing(object sender, FormClosingEventArgs e)
		{
			if (e.CloseReason == CloseReason.UserClosing)
			{
				this.Hide();
				e.Cancel = true;
			}
		}
		
		public void AddDebugText(string debugText, bool useTimestamp = true)
		{
			if (useTimestamp)
			{				
				string timestamp = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
				DebugText.AppendText(timestamp + " : " + debugText + Environment.NewLine);
			}
			else
				DebugText.AppendText(debugText + Environment.NewLine);
		}
	}
}
